package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the deliveryschedule database table.
 * 
 */
@Entity
@NamedQuery(name="Deliveryschedule.findAll", query="SELECT d FROM Deliveryschedule d")
public class Deliveryschedule implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="ds_id")
	private int dsId;

	@Temporal(TemporalType.DATE)
	@Column(name="ds_date")
	private Date dsDate;

	@Column(name="ds_money")
	private BigDecimal dsMoney;

	//bi-directional many-to-one association to Deliverdetail
	@OneToMany(mappedBy="deliveryschedule")
	private List<Deliverdetail> deliverdetails;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cus_id")
	private Customer customer;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="ds_state")
	private Dictionary dictionary;

	//bi-directional many-to-one association to Orderform
	@ManyToOne
	@JoinColumn(name="o_id")
	private Orderform orderform;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="use_id")
	private User user;

	public Deliveryschedule() {
	}

	public int getDsId() {
		return this.dsId;
	}

	public void setDsId(int dsId) {
		this.dsId = dsId;
	}

	public Date getDsDate() {
		return this.dsDate;
	}

	public void setDsDate(Date dsDate) {
		this.dsDate = dsDate;
	}

	public BigDecimal getDsMoney() {
		return this.dsMoney;
	}

	public void setDsMoney(BigDecimal dsMoney) {
		this.dsMoney = dsMoney;
	}

	public List<Deliverdetail> getDeliverdetails() {
		return this.deliverdetails;
	}

	public void setDeliverdetails(List<Deliverdetail> deliverdetails) {
		this.deliverdetails = deliverdetails;
	}

	public Deliverdetail addDeliverdetail(Deliverdetail deliverdetail) {
		getDeliverdetails().add(deliverdetail);
		deliverdetail.setDeliveryschedule(this);

		return deliverdetail;
	}

	public Deliverdetail removeDeliverdetail(Deliverdetail deliverdetail) {
		getDeliverdetails().remove(deliverdetail);
		deliverdetail.setDeliveryschedule(null);

		return deliverdetail;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Dictionary getDictionary() {
		return this.dictionary;
	}

	public void setDictionary(Dictionary dictionary) {
		this.dictionary = dictionary;
	}

	public Orderform getOrderform() {
		return this.orderform;
	}

	public void setOrderform(Orderform orderform) {
		this.orderform = orderform;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}